//
//  IGRegisterApi.m
//  jingdongfang
//
//  Created by BOE on 2017/9/6.
//  Copyright © 2017年 LJL. All rights reserved.
//

#import "IGRegisterApi.h"

@interface IGRegisterApi()
    
@property (nonatomic, copy) NSString *username;
@property (nonatomic, copy) NSString *password;
@property (nonatomic, copy) NSString *smsCode;

@end

@implementation IGRegisterApi
    
- (id)initWithUsername:(NSString *)username password:(NSString *)password smsCode:(NSString *)smsCode {
    self = [super init];
    if (self) {
        _username = username;
        _password = password;
        _smsCode = smsCode;
    }
    return self;
}
    
- (NSString *)requestUrl {
    return @"member/register";
}
    
- (BOOL)isNeedHub {
    return YES;
}

- (BOOL)isHttps {
    return YES;
}
    
- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodPOST;
}
    
- (id)requestArgument {
    return @{
             @"phoneNo": _username,
             @"password": _password,
             @"smsCode": _smsCode
             };
}
    
@end

@implementation IGRegisterModel
    
+ (JSONKeyMapper *)keyMapper
    {
        return [[JSONKeyMapper alloc]
                initWithModelToJSONDictionary:@{
                                                @"userinfo":@"member"
                                                }];
    }
    
@end

@implementation IGRegisterResp
    
+ (BOOL)propertyIsOptional:(NSString *)propertyName {
    return YES;
}
    
@end
